//
//  PPCameraAuthorization.m
//  pet
//
//  Created by 陈无忌 on 12/3/14.
//  Copyright (c) 2014 whalefin. All rights reserved.
//

#import "PPCameraAuthorization.h"

@implementation PPCameraAuthorization

+ (void)getCameraAuthorization
{
    double version = [[UIDevice currentDevice].systemVersion doubleValue];
    if(version>=7.0f){
        // 判断程序的隐私设置是否授予权限
        AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
        if (authStatus != AVAuthorizationStatusDenied || authStatus != AVAuthorizationStatusRestricted){
            [PPSystemConfiguraton sharedSystemConfiguration].isCameraValid = YES;
        }else{
            [PPSystemConfiguraton sharedSystemConfiguration].isCameraValid = NO;
        }
    }
}

@end
